]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
slider: Include handle border radius when calculating center offset
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 1 Mar 2020 13:01:14 +0000 (14:01 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 6 Mar 2020 19:29:06 +0000 (19:29 +0000)
Since 38da479ee we correctly ceil the non-integer radius of the slider
handle when calculating the offset for drawing the circle. Since the
handle also has a border with a width of 1px by default, we should also
factor that in when calculating the offset.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1569

js/ui/slider.js

index 01b29e1fc26db9475a15fd0e055e37d6da89decf..3a732e9cf466f67e5a5d3f03aec45a017a4cbbc4 100644 (file)
@@ -43,10 +43,10 @@ var Slider = GObject.registerClass({
         let [hasHandleColor, handleBorderColor] =
             themeNode.lookup_color('-slider-handle-border-color', false);
 
-        let wholeHandleRadius = Math.ceil(handleRadius);
-        let handleX = wholeHandleRadius +
-            (width - 2 * wholeHandleRadius) * this._value / this._maxValue;
-        let handleY = height / 2;
+        const ceiledHandleRadius = Math.ceil(handleRadius + handleBorderWidth);
+        const handleX = ceiledHandleRadius +
+            (width - 2 * ceiledHandleRadius) * this._value / this._maxValue;
+        const handleY = height / 2;
 
         let color = themeNode.get_foreground_color();
         Clutter.cairo_set_source_color(cr, color);